<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>SYMMETRY: engine::cThreadPool Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">SYMMETRY
   </div>
   <div id="projectbrief">ENGINEFORSCIENTIFICCOMPUTATION,VISUALIZATIONANDSIMULATION</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classengine_1_1cThreadPool.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classengine_1_1cThreadPool-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">engine::cThreadPool Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="thread__pool_8h_source.html">thread_pool.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for engine::cThreadPool:</div>
<div class="dyncontent">
<div class="center"><img src="classengine_1_1cThreadPool__coll__graph.png" border="0" usemap="#engine_1_1cThreadPool_coll__map" alt="Collaboration graph"/></div>
<map name="engine_1_1cThreadPool_coll__map" id="engine_1_1cThreadPool_coll__map">
<area shape="rect" id="node2" href="classengine_1_1cCommandQueue.html" title="{engine::cCommandQueue\n|&#45; m_Mutex\l&#45; m_NotEmptyCond\l|+ cCommandQueue()\l+ ~cCommandQueue()\l+ Put()\l+ Put()\l+ Remove()\l+ Empty()\l+ GetSize()\l# Put_i()\l# Remove_i()\l# Empty_i()\l# GetSize_i()\l}" alt="" coords="10,446,192,685"/><area shape="rect" id="node4" title="STL class. " alt="" coords="42,147,160,224"/></map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1cef23416a63c1a652d07b074a40b42e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1cef23416a63c1a652d07b074a40b42e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>cThreadPool</b> (unsigned int num_threads)</td></tr>
<tr class="separator:a1cef23416a63c1a652d07b074a40b42e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97cf0269aebd226e59d973a89181d709"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a97cf0269aebd226e59d973a89181d709"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>StartPool</b> ()</td></tr>
<tr class="separator:a97cf0269aebd226e59d973a89181d709"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeafab9fa5546e10b0deebff1e8df60d9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeafab9fa5546e10b0deebff1e8df60d9"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>StopPool</b> ()</td></tr>
<tr class="separator:aeafab9fa5546e10b0deebff1e8df60d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a755828410b0f6a32c3cb2c3f88a4c0a4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a755828410b0f6a32c3cb2c3f88a4c0a4"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>AddToCommandQueue</b> (std::shared_ptr&lt; <a class="el" href="classengine_1_1cCommand.html">cCommand</a> &gt; &amp;command, <a class="el" href="classengine_1_1cSession.html">cSession</a> *session)</td></tr>
<tr class="separator:a755828410b0f6a32c3cb2c3f88a4c0a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a207b8bcf506d3cd151f0fc815772111c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a207b8bcf506d3cd151f0fc815772111c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>isStarted</b> () const </td></tr>
<tr class="separator:a207b8bcf506d3cd151f0fc815772111c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:af573f11026d6b6079c56af7e50df5ca6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classengine_1_1cThreadPool.html#af573f11026d6b6079c56af7e50df5ca6">Run</a> ()</td></tr>
<tr class="separator:af573f11026d6b6079c56af7e50df5ca6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ae0439f245252951c72e929fcb5f12ea7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae0439f245252951c72e929fcb5f12ea7"></a>
boost::thread_group&#160;</td><td class="memItemRight" valign="bottom"><b>m_ThreadPool</b></td></tr>
<tr class="separator:ae0439f245252951c72e929fcb5f12ea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e8295a610871d54220f068d447e4b3d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e8295a610871d54220f068d447e4b3d"></a>
<a class="el" href="classengine_1_1cCommandQueue.html">cCommandQueue</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_CommandQueue</b></td></tr>
<tr class="separator:a9e8295a610871d54220f068d447e4b3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a9ba1d9f84c6edf6312c358973c1e75"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a9ba1d9f84c6edf6312c358973c1e75"></a>
volatile unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>m_Num_Threads</b></td></tr>
<tr class="separator:a5a9ba1d9f84c6edf6312c358973c1e75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a665b990bbfe85aa6dd9be2691373e2d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a665b990bbfe85aa6dd9be2691373e2d7"></a>
volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>m_Started</b></td></tr>
<tr class="separator:a665b990bbfe85aa6dd9be2691373e2d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>thread pool class uses a queue to hold the commands received </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af573f11026d6b6079c56af7e50df5ca6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void engine::cThreadPool::Run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>function that runs in all the threads waits until the queue is not empty and process incoming commands </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="thread__pool_8h_source.html">thread_pool.h</a></li>
<li>thread_pool.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceengine.html">engine</a></li><li class="navelem"><a class="el" href="classengine_1_1cThreadPool.html">cThreadPool</a></li>
    <li class="footer">Generated on Tue Feb 25 2014 17:12:06 for SYMMETRY by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
